import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
import myindex from '@/components/myindex'
import tail from '@/components/tail'
import head from '@/components/head'
import zhuce from '@/components/zhuce'
import center from '@/components/center'
// import myhome from '@/components/myhome'
import myhome from '@/components/myhome'
import ding from '@/components/ding'
import right from '@/components/right'
import mayun from '@/components/mayun'
import mycate from '@/components/mycate'
import showcate from '@/components/showcate'
import addcouse from '@/components/addcouse'
import courselist from '@/components/courselist'
Vue.use(Router)


var routes = [
        {
          path:'/courselist',
          name:'courselist',
          component:courselist
        },
        {
          path:'/addcouse',
          name:'addcouse',
          component:addcouse
        },
        {
          path:'/mycate',
          name:'mycate',
          component:mycate
        },
        {
          path:'/showcate',
          name:'showcate',
          component:showcate
        },
        {
          path:'/',
          name:'index',
          component:index
        },
        {
          path:'/myindex',
          name:'myindex',
          component:myindex
        },
        {
          path:'/tail',
          name:'tail',
          component:tail
        },
        {
          path:'/head',
          name:'head',
          component:head,
         
        },
        {
          path:'/zhuce',
          name:'zhuce',
          component:zhuce
        },
        {
          path:'/center',
          name:'center',
          component:center
        },
        {
          path:'/ding',
          name:'ding',
          component:ding
        },
        {
          path:'/right',
          name:'right',
          component:right,
          // beforeEnter:(to,from,next) => {
          //     if(localStorage.getItem('username')){
          //       console.log('登陆了')
          //       next();
          //     }else{
          //       next('/myhome');
          //     }
          // }
        },
        {
          path:'/mayun',
          name:'mayun',
          component:mayun
        },
        {
          path:'/myhome',
          name:'myhome',
          component:myhome,
          // beforeEnter:(to,from,next) => {
          //     if(localStorage.getItem('username')){
          //       console.log('登陆了')
          //     }else{
          //       next('/head');
          //     }
          // }
        },
        

        
        
        
        
]

export default new Router({
  routes:routes,
  mode:'history'   /*hash*/
})
